import request from '@/utils/request'

// 获取大屏统计数据
export function getDashboardStats() {
  return request({
    url: '/dashboard/stats',
    method: 'get'
  })
}

// 获取车辆状态统计
export function getVehicleStats() {
  return request({
    url: '/dashboard/vehicle-stats',
    method: 'get'
  })
}

// 获取电量统计
export function getBatteryStats() {
  return request({
    url: '/dashboard/battery-stats',
    method: 'get'
  })
}

// 获取换电业务统计
export function getChargingStats() {
  return request({
    url: '/dashboard/charging-stats',
    method: 'get'
  })
}

// 获取告警统计
export function getAlertStats() {
  return request({
    url: '/dashboard/alert-stats',
    method: 'get'
  })
}

// 获取区域统计
export function getAreaStats() {
  return request({
    url: '/dashboard/area-stats',
    method: 'get'
  })
}

// 获取待确认订单
export function getPendingOrders() {
  return request({
    url: '/dashboard/pending-orders',
    method: 'get'
  })
}

// 获取最近告警
export function getRecentAlerts() {
  return request({
    url: '/dashboard/recent-alerts',
    method: 'get'
  })
}

// 获取车辆实时位置
export function getVehicleLocations() {
  return request({
    url: '/dashboard/vehicle-locations',
    method: 'get'
  })
}

// 获取换电平台状态
export function getPlatformStatus() {
  return request({
    url: '/dashboard/platform-status',
    method: 'get'
  })
}

// 获取换电车位置
export function getTruckLocations() {
  return request({
    url: '/dashboard/truck-locations',
    method: 'get'
  })
}

// 获取调度路线
export function getDispatchRoutes() {
  return request({
    url: '/dashboard/dispatch-routes',
    method: 'get'
  })
}

// 获取电量趋势数据
export function getBatteryTrend(params) {
  return request({
    url: '/dashboard/battery-trend',
    method: 'get',
    params
  })
}

// 获取换电趋势数据
export function getChargingTrend(params) {
  return request({
    url: '/dashboard/charging-trend',
    method: 'get',
    params
  })
}

// 获取车辆类型分布
export function getVehicleTypeDistribution() {
  return request({
    url: '/dashboard/vehicle-type-distribution',
    method: 'get'
  })
}

// 确认订单
export function confirmOrder(orderId, remark) {
  return request({
    url: `/dashboard/confirm-order/${orderId}`,
    method: 'post',
    data: { remark }
  })
}

// 取消订单
export function cancelOrder(orderId, reason) {
  return request({
    url: `/dashboard/cancel-order/${orderId}`,
    method: 'post',
    data: { reason }
  })
}

// 获取天气信息
export function getWeatherInfo() {
  return request({
    url: '/dashboard/weather',
    method: 'get'
  })
}

// 获取系统运行状态
export function getSystemStatus() {
  return request({
    url: '/dashboard/system-status',
    method: 'get'
  })
}